package com.yuanqi.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 销售退货订单明细
 * @TableName sales_return_order_item
 */
@TableName(value ="sales_return_order_item")
@Data
public class SalesReturnOrderItem implements Serializable {
    /** 主键 */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 关联退货单主表ID */
    @TableField("return_order_id")
    private Long returnOrderId;

    /** 关联原销售订单商品子表ID */
    @TableField("order_item_id")
    private Long orderItemId;

    /** 退货数量 */
    @TableField("return_quantity")
    private Integer returnQuantity;

    /** 退货单价 */
    @TableField("return_price")
    private BigDecimal returnPrice;

    /** 退货金额 */
    @TableField("return_amount")
    private BigDecimal returnAmount;

    /** 退货原因 */
    private String reason;

    /** 商品ID */
    @TableField("product_id")
    private Long productId;

    /** 商品名称 */
    @TableField("product_name")
    private String productName;

    /** SKU ID */
    @TableField("sku_id")
    private Long skuId;

    /** SKU编码 */
    @TableField("sku_code")
    private String skuCode;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SalesReturnOrderItem other = (SalesReturnOrderItem) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", returnOrderId=").append(returnOrderId);
        sb.append(", orderItemId=").append(orderItemId);
        sb.append(", returnQuantity=").append(returnQuantity);
        sb.append(", returnPrice=").append(returnPrice);
        sb.append(", returnAmount=").append(returnAmount);
        sb.append(", reason=").append(reason);
        sb.append(", productId=").append(productId);
        sb.append(", productName=").append(productName);
        sb.append(", skuId=").append(skuId);
        sb.append(", skuCode=").append(skuCode);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
